fix potential buffer overrun in dg-100.cc
authortsteven4 <tsteven4@gmail.com>
Thu, 13 Feb 2014 00:27:45 +0000 (00:27 +0000)
committertsteven4 <tsteven4@gmail.com>
Thu, 13 Feb 2014 00:27:45 +0000 (00:27 +0000)
gpsbabel/dg-100.cc

index 71d6bb470630dac0473202fe4cf2386c61c2c58d..0f1d04cbec62852d2c989f3953f8cf44ccd8ae1e 100644 (file)
@@ -258,7 +258,7 @@ process_gpsfile(uint8_t data[], route_head** track)
       bintime = be_read32(data + i +  8) & 0x7FFFFFFF;
       bindate = be_read32(data + i + 12);
       creation_time = bintime2utc(bindate, bintime);
-      strftime(buf, 4096, "DG-100 tracklog (%Y/%m/%d %H:%M:%S)",
+      strftime(buf, sizeof(buf), "DG-100 tracklog (%Y/%m/%d %H:%M:%S)",
                gmtime(&creation_time));
       *track = route_head_alloc();
       (*track)->rte_name = buf;